﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
//using Base.Utils;
using System.Data.SqlClient;
using System.Data;

namespace UILGestion.Mapa
{
    public partial class WebFormfinal : System.Web.UI.Page
    {
         protected void Page_Load(object sender, EventArgs e)
        {
           
            string pClientScript = "";
            string xMapa = "";
           
            //oFs.Chk_Session(this);
           
            #region Manejo PostBack
            if (!IsPostBack)
            {
                Ini_Controls();
            }
            //else
            //{
            //    if (oFs.Obtener_ValorCampoOculto(this, "Modo") == "EDET")
            //    {
            //        Eliminar_Detalle();
            //        Cargar_ListaDetalle();
            //    }
            //    else if (oFs.Obtener_ValorCampoOculto(this, "Modo") == "EDETP")
            //    {
            //        Eliminar_ProformaDetalle();
            //        Cargar_ListaProformaDetalle();
            //    }
            //    else if (oFs.Obtener_ValorCampoOculto(this, "Modo") == "GREP")
            //    {
            //        Grabar_Representante();
            //    }
            //    else if (oFs.Obtener_ValorCampoOculto(this, "Modo") == "EVEREQ")
            //    {
            //        Eliminar_VentaRequerimiento();
            //        Cargar_Lista_Requerimiento();
            //    }
            //}
            #endregion

            this.ClientScript.RegisterHiddenField("Modo", "");
            this.ClientScript.RegisterHiddenField("DATA", "");
        }

        private string ColorUnidad(string xEstado, string xDisponible, string pTipo, string pSeleccionado)
        {
            string xColor = "";
            if (pTipo == "VEN")
            {
                if (pSeleccionado == "1")
                {
                    xColor = "{stroke:false,fillColor:<1MA>3366FF<1MA>,fillOpacity:0.4,alwaysOn:true}";
                }
                else
                {
                    if (xEstado == "VEN")
                        xColor = "{stroke:false,fillColor:<1MA>EE0481<1MA>,fillOpacity:0.4,alwaysOn:true}";
                    else if (xEstado == "SEL")
                        xColor = "{stroke:false,fillColor:<1MA>009900<1MA>,fillOpacity:0.4,alwaysOn:true}";
                    else
                    {
                        if (xDisponible == "0")
                            xColor = "{stroke:false,fillColor:<1MA>96999C<1MA>,fillOpacity:0.4,alwaysOn:true}";
                        else
                            xColor = "";
                    }
                }
            }
            else if (pTipo == "PROF")
            {
                if (pSeleccionado == "1")
                {
                    xColor = "{stroke:false,fillColor:<1MA>3366FF<1MA>,fillOpacity:0.4,alwaysOn:true}";
                }
                else
                {
                    if (xEstado == "VEN")
                        xColor = "{stroke:false,fillColor:<1MA>EE0481<1MA>,fillOpacity:0.4,alwaysOn:true}";
                    else
                    {
                        if (xDisponible == "0")
                            xColor = "{stroke:false,fillColor:<1MA>96999C<1MA>,fillOpacity:0.4,alwaysOn:true}";
                    }
                }
            }
            else if (pTipo == "PROFWEB")
            {
                if (xDisponible == "0")
                    xColor = "{stroke:false,fillColor:<1MA>96999C<1MA>,fillOpacity:0.4,alwaysOn:true}";
            }

            return xColor;

        }



        public Collection<string[]> MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener1(int pCodPro, int pCodEtapa, int pSubDet, string pTipo, string pModelo, int pDetalle)
        {
            string[] oTo;
            Collection<string[]> oLista = new Collection<string[]>();
            SqlConnection oCn = new SqlConnection();
           
            SqlCommand oCm = new SqlCommand();
            SqlDataReader oSqlR = null;

            oCm.CommandType = CommandType.StoredProcedure;
            oCm.CommandText = "pr_MapaProyectoEtapa_SubDetalle_X_Tipo_X_Modelo_Obtener";

            try
            {

                oCn.ConnectionString = @"Data Source=192.168.1.208\SQL01;Database=BDESPARQ;User Id=sa;Password=EOMsql2008;";
                oCn.Open();
                oCm.Connection = oCn;

                oCm.Parameters.Add("@IN_ID_PRO", SqlDbType.Int);
                oCm.Parameters.Add("@IN_ID_ETA", SqlDbType.Int);
                oCm.Parameters.Add("@IN_ID_SUBD", SqlDbType.Int);
                oCm.Parameters.Add("@VC_TIPO", SqlDbType.VarChar);
                oCm.Parameters.Add("@VC_COD_UHAB", SqlDbType.VarChar);
                oCm.Parameters.Add("@IN_ID_DETCON", SqlDbType.Int);


                oCm.Parameters["@IN_ID_PRO"].Value = pCodPro;
                oCm.Parameters["@IN_ID_ETA"].Value = pCodEtapa;
                oCm.Parameters["@IN_ID_SUBD"].Value = pSubDet;
                oCm.Parameters["@VC_TIPO"].Value = pTipo;
                oCm.Parameters["@VC_COD_UHAB"].Value = pModelo;
                oCm.Parameters["@IN_ID_DETCON"].Value = pDetalle;


                oSqlR = oCm.ExecuteReader();

                while (oSqlR.Read())
                {
                    oTo = new string[12];

                    oTo[0] = oSqlR[0].ToString(); //ID
                    oTo[1] = oSqlR[1].ToString(); //NroLote
                    oTo[2] = oSqlR[2].ToString(); //Area     
                    oTo[3] = oSqlR[3].ToString(); //Estado  
                    oTo[4] = oSqlR[4].ToString(); //precio   
                    oTo[5] = oSqlR[5].ToString(); //moneda   
                    if (oSqlR[7].ToString() == "N")
                        oTo[6] = oSqlR[1].ToString() + ", area:" + oSqlR[2].ToString() + ", precio: " + oSqlR[5].ToString() + " " + double.Parse(oSqlR[4].ToString()).ToString("N"); //junto
                    else if (oSqlR[7].ToString() == "A")
                        oTo[6] = oSqlR[1].ToString() + ", area:" + oSqlR[2].ToString() + ", precio: " + oSqlR[5].ToString() + " " + double.Parse(oSqlR[8].ToString()).ToString("N"); //junto
                    else if (oSqlR[7].ToString() == "T")
                        oTo[6] = oSqlR[1].ToString() + ", area:" + oSqlR[2].ToString() + ", precio: " + oSqlR[5].ToString() + " " + (double.Parse(oSqlR[2].ToString()) * double.Parse(oSqlR[9].ToString())).ToString("N"); //junto

                    oTo[7] = oSqlR[6].ToString(); //disponible para la venta   
                    oTo[8] = oSqlR[7].ToString(); //Forma Venta
                    oTo[9] = oSqlR[8].ToString(); //precio Ampliado
                    oTo[10] = oSqlR[9].ToString(); //precio M2
                    oTo[11] = oSqlR[11].ToString(); //Si esta seleccionado

                    oLista.Add(oTo);
                }
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (oSqlR != null) oSqlR.Close();
                oCm.Dispose();
                oCn.Dispose();
            }
            return (oLista);
        }

        public Collection<string[]> MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener(int pCodPro, int pCodEtapa, int pSubDet, string pTipo, string pModelo, int pDetalle)
        {
          
            Collection<string[]> oLista = new Collection<string[]>();

            try
            {
                oLista = this.MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener1(pCodPro, pCodEtapa, pSubDet, pTipo, pModelo, pDetalle);
            }
            catch (Exception ex)
            {
               

            }
            return (oLista);
        }

        private string SanGabriel_Etapa1_Torre1_00(int pIdProyecto, int pIdEtapa, int pIdSubDedalle, string pTipo, int pDetalle)
        {
         
            Collection<string[]> oLista = new Collection<string[]>();
            //oLista = oBo.MapaProyectoEtapa_SubDetalle_xTipo_Obtener(pIdProyecto, pIdEtapa, pIdSubDedalle,"DPTO");        
            string[] xValor;
            string Datos = "";

            string xruta = "";
                                     
            xruta = "<div class='map' style='display: block; repeat scroll 0% 0% transparent; position: relative; padding: 0px; width: 221px; height: 215px;'>";
            //xruta = xruta + "<canvas height='215' width='221' style='position: absolute; left: 0px; top: 0px; padding: 0px; border: 0px none; opacity: 1;'></canvas>";
            //xruta = xruta + "<canvas width='221' height='215' style='width: 221px; height: 215px; position: absolute; left: 0px; top: 0px; padding: 0px; border: 0px none; opacity: 1;'><v:rect></v:rect>";
            //xruta = xruta + "</canvas>";
            xruta = xruta + "<img src='alamost01.png' class='map maphilighted' usemap='#si_etapa1_Modelo' width='221' height='215' border='0'>";
            xruta = xruta + "</div>";

            xruta = xruta + "<map class='tabs' name='si_etapa1_Modelo'>";
            //-----------------------------------------------
            oLista = this.MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener(pIdProyecto, pIdEtapa, pIdSubDedalle, "DPTO", "01", pDetalle);
            xValor = oLista.ElementAt(0);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,145,70,163' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(1);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,128,70,146' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(2);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,111,70,129' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(3);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,94,70,112' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(4);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,77,70,95' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(5);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,60,70,78' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(6);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,43,70,61' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(7);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='22,26,70,44' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";
            //-----------------------------------------------------

            oLista = this.MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener(pIdProyecto, pIdEtapa, pIdSubDedalle, "DPTO", "02", pDetalle);
            xValor = oLista.ElementAt(0);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,145,119,163' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(1);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,128,119,146' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(2);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,111,119,129' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(3);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,94,119,112' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(4);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,77,119,95' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(5);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,60,119,78' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(6);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,43,119,61' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(7);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='71,26,119,44' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            //------------------------------------------------------
            oLista = this.MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener(pIdProyecto, pIdEtapa, pIdSubDedalle, "DPTO", "03", pDetalle);
            xValor = oLista.ElementAt(0);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,145,166,163' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(1);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,128,166,146' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(2);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,111,166,129' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(3);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,94,166,112' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(4);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,77,166,95' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(5);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,60,166,78' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(6);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,43,166,61' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(7);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='118,26,166,44' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";
            //-----------------------------------------

            oLista = this.MapaProyectoEtapa_SubDetalle_xTipo_xModelo_Obtener(pIdProyecto, pIdEtapa, pIdSubDedalle, "DPTO", "04", pDetalle);
            xValor = oLista.ElementAt(0);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,145,214,163' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(1);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,128,214,146' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(2);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,111,214,129' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(3);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,94,214,112' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(4);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,77,214,95' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(5);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,60,214,78' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(6);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,43,214,61' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";

            xValor = oLista.ElementAt(7);
            xruta = xruta + "<area shape='rect' title='" + xValor[6] + "' coords='166,26,214,44' href='#' class='" + ColorUnidad(xValor[3], xValor[7], pTipo, xValor[11]) + "' onClick='parent.Grabar_Detalle(<1MA>" + xValor[0] + "<1MA>,<1MA>" + xValor[3] + "<1MA>,<1MA>" + xValor[7] + "<1MA>);'>";




            xruta = xruta + "</map>";

            return (xruta);
        }


        private void Ini_Controls()
        {
           
           
           
         
         
            string xMapa = "";
            string[] xCC;
         
            //string[] xPagina = Request.UrlReferrer.Segments;
            //hdForm.Value = xPagina[(xPagina.Length - 1)];



            hdIdPro.Value = "209";
            hdIdEta.Value = "378";
            hdIdSubDet.Value = "197";
           
            hdCodDet.Value = "0";

            xMapa = this.SanGabriel_Etapa1_Torre1_00(int.Parse(hdIdPro.Value), 
                int.Parse(hdIdEta.Value),
                int.Parse(hdIdSubDet.Value), 
                 "VEN", 
                int.Parse(hdCodDet.Value)).Replace(char.ConvertFromUtf32(39), char.ConvertFromUtf32(34));
            litMapa.Text = xMapa.Replace("<1MA>", char.ConvertFromUtf32(39));

           
          


        }

    }
    }
